Thresholding is a fundamental low-level operation in several image processing applications. In its simplest form, thresholding is done on an input image to obtain a binary image including foreground and background pixels that can be further processed to extract an object.
Hysteresis thresholding is a more effective thresholding technique in the presence of noise. Thresholding with hysteresis uses two thresholds: a low threshold Tlo and a high threshold Thi. Pixels having a magnitude greater than the high threshold Thi are marked as strong foreground pixels, and pixels having a magnitude lower than the low threshold Tlo are marked as background pixels. Pixels having a magnitude below the high threshold Thi but above the low threshold Tlo are initially identified as weak foreground pixels. These weak foreground pixels are subsequently considered as strong foreground pixels only if they are connected to a strong foreground pixel (e.g., a pixel with a magnitude above the high threshold Thi).
Further, in many detection applications, a background model is defined. In such applications, instead of comparing a pixel intensity against the low and high thresholds, a difference relative to the background model is compared against low and high thresholds to determine foreground and background pixels.
Both types of thresholding (i.e., absolute magnitude and magnitude relative to a background) can also be applied to a magnitude of a gradient, rather than a pixel magnitude. Then, the thresholding provides edge information of a foreground object rather than giving the complete foreground object itself. This edge information can be used to extract contour properties.
For binary images, conventional algorithms use connected component analysis or contour tracing to extract properties. In such algorithms, a connected component labeling is performed first, and the properties are then extracted from each labeled object. For hysteresis thresholded images, weak foreground pixels are traced to mark them as background or strong foreground pixels. Thus, edge/pixel tracing is performed to classify the weak foreground pixels as either strong foreground or background pixels.
Conventional algorithms for object/contour feature extraction work in many stages or passes over a thresholded image. If the image is hysteresis thresholded, two or more passes are required for classifying the weak foreground/edge pixels as foreground/background pixels. This follows connected component analysis which also requires multiple passes to label each object. For each detected object, properties are extracted or a contour detection algorithm is required to extract the contour and its properties.
Most often, these techniques are time consuming and require multiple passes for contour extraction, especially for objects with concave boundaries. Such contour extraction also requires a large amount of memory resources due to its recursive nature. Further, accesses to the memory are typically random, which makes it difficult to use cache and Direct Memory Access (DMA) for typical embedded processors.
FIG. 1 shows an example of various stages of object/contour feature extraction in an image including two objects. In particular, FIG. 1(a) shows background pixels in white, weak foreground pixels in light grey, and strong foreground pixels in dark grey. FIG. 1(b) shows the binarized image after pixel tracing. The weak foreground pixels have either been discarded or categorized as strong foreground pixels. FIG. 1(c) shows the labeled objects after component labeling. Further, the feature extraction yields sizes of 4 for object 1 and 3 for object 2. There are many techniques proposed for each of the illustrated stages. As these techniques include many stages that require many passes through the image, these techniques consume too much execution time.
One algorithm attempts to extract object features from a binary image in a single pass. However, it uses complex translation tables and merger tables to extract the features. The algorithm does not address hysteresis thresholded images and does not consider contour properties.
Further, a modified algorithm does address hysteresis thresholded images. However, this modified algorithm makes use of the same translation tables and does not attempt to extract contour properties.